<?php
class forgetModel extends baseModel{

    //发送注册邮件验证
    public function email($info){

        $config=appConfig('member');
        $config=$config['APP_SETTING'];

        //发送邮件
        $url='http://'.$_SERVER["HTTP_HOST"].url('member/email/post');
        //邮件标题
        $title=$config['login_forget_title'];
        $title=str_replace('{sitename}', $config['info_title'], $title);
        $title=str_replace('{username}', $info['username'], $title);
        //邮件内容
        $content=html_out($config['login_forget_content']);
        $content=str_replace('{username}', $info['username'], $content);
        $content=str_replace('{sitename}', $config['info_title'], $content);
        $content=str_replace('{time}', date('Y年m月d日 H点i分s秒'), $content);
        $content=str_replace('{url}', 'http://'.$_SERVER["HTTP_HOST"], $content);
        //新密码
        $code=getcode(6);
        $content=str_replace('{password}',$code , $content);
        $data=array();
        $data['uid']=$info['uid'];
        $data['password']=md5($code);
        model('user_list')->edit($data);
        //发送
        $mail_array=array();
        $mail_array['email']=$info['email'];
        $mail_array['title']=$title;
        $mail_array['content']=$content;
        $sys_config=config('APP');
        $mail_array['SAFE_KEY']=$sys_config['SAFE_KEY'];
        Http::doPost($url,$mail_array,1);


    }

    
    


}